import { createApp } from 'vue'
import './style.scss'
import App from './App.vue'
import router from './router/index'
import { createPinia } from 'pinia'
import { Http } from '@/utils/http'
import components from '@/components/index'
import i18n from '@/i18n/index'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/display.css'
import ElementPlus from 'element-plus'
import directive from '@/directive'
import '@/plugin/last-commit-msg/toggle.js'
import { mockRuqest } from './mock'
import { registerMicroApps, start } from 'qiankun'
import microApp from './utils/micro-app'
// import '@/utils/qiankun-action'

// console.log('-----------------main app -----------------')
Http.init()

if (import.meta.env.MODE === 'mock') {
	mockRuqest()
}

const store = createPinia()
const app = createApp(App)

registerMicroApps(microApp)
start({
	// prefetch: false // 取消预加载
	singular: true
})

app.use(ElementPlus)
app.use(store)
app.use(router)
app.use(components)
app.use(i18n)
app.use(directive)
app.mount('#app')

